package com.gopay.common.cps.dao.bank.impl;

import com.gopay.common.base.dao.impl.BaseDAOImpl;
import com.gopay.common.cps.dao.bank.CustAppInfoDAO;
import com.gopay.common.domain.bank.CustAppInfo;
import org.springframework.stereotype.Repository;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author jianglijun
 * @ClassName: CustAppInfoDAOImpl.java
 * @Description: 商户管理表dao实现类
 * @date 2016年9月27日 下午3:57:35
 */
@Repository("commonCustAppInfoDAO")
public class CustAppInfoDAOImpl extends BaseDAOImpl<CustAppInfo, Serializable> implements CustAppInfoDAO {

    /**
     * @Description: 根据custId、appId查询出商户应用关联表信息
     * @param custId
     * @param appId
     * @return
     * @author jianglijun
     */
    @Override
    public CustAppInfo getCustAppInfoByAppId(String custId, String appId) {
        Map<String, Object> params = new HashMap<>(2);
        params.put("custId", custId);
        params.put("appId", appId);
        List<CustAppInfo> list = super.findByHql("from CustAppInfo where custId=:custId and appId=:appId ", params);
        return list.size() > 0 ? list.get(0) : null;
    }
}
